package com.pes.arcww.service;

import java.util.Collection;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.pes.arcww.form.Users;
import com.pes.arcww.dao.UsersDAO;

@Service("userService")
public class UsersServiceImpl implements UsersService{

	@Autowired
	private UsersDAO userDAO;
	
	@Transactional
	public void addUser(Users user) {
		userDAO.addUser(user);
	}
	
	@Transactional
	public Collection<Users> listUsers(String filter, String value){
		return userDAO.listUsers(filter, value);
	}

	@Transactional
	public void removeUser(String email) {
		userDAO.removeUser(email);
	}

	@Transactional
	public void updateUser(Users user) {
		userDAO.updateUser(user);
	}
	
	@Transactional
	public Boolean validate(String email, String password) {
		return userDAO.validate(email, password);
	}

	@Transactional
	public Users getUser(String email) {
		return userDAO.getUser(email);
	}

}
